/*
 * @Author: XieQiu 雪球
 * @Date: 2021-05-25 14:17:03
 * @LastEditTime: 2022-04-28 09:56:35
 * @LastEditors: Please set LastEditors
 * @Description: 土地划分管理接口
 */
import xjaxios from "@/utils/request";

export default {
  /**
   * @description: 获取划分信息列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getDivideList(params) {
    params.entity = params.entity || {};
    params.entity.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post("/v3/facility/facility/queryPageByCondition", params);
  },

  /**
   * @description: 新增土地划分信息
   * @param {Object} formData *
   * @return {Object}
   */
  addDivideInfo(formData) {
    return xjaxios.post("/v3/facility/facility/add", formData);
  },

  /**
   * @description: 修改土地划分信息
   * @param {Object} formData *
   * @return {Object}
   */
  editDivideInfo(formData) {
    // formData.organizationNo = sessionStorage.organizationNo;
    return xjaxios.post("/v3/facility/facility/edit", formData);
  },
  editStatus(formData) {
    return xjaxios.post("/v3/facility/facility/editFalseStatus", formData);
  },
  /**
   * @description: 删除土地划分信息
   * @param {Object} formData *
   * @return {Object}
   */
  delDivideInfo(list) {
    return xjaxios.post("/v3/facility/facility/delListByNo", {
      noList: list
    });
  },

  // 获取所有设施信息
  getFacilityListByConditionall(params) {
    return xjaxios.post("/v3/facility/facility/queryByCondition", {
      // organizationNo: sessionStorage.organizationNo,
      // facilityNameLike: params.facilityName
      facilityStatus: false,
      isDistribution: params.isDistribution
    });
  },
  /**
   * @description: 条件获取所有设施信息
   * @param {String} organizationNo *
   * @return {Array}
   */

  getFacilityListByConditionAll(params) {
    return xjaxios.post("/v3/facility/facility/queryByCondition", params);
  },
  // facilityManage/facilityGroupMapper/queryByFacilityGroupId

  /**
   * @description: 主键查询设施信息
   * @param {String} facilityId *
   * @return {Array}
   */
  queryFacilityById(facilityId) {
    return xjaxios.get(`/v3/facility/facility/queryByNo?no=${facilityId}`);
  },
  // queryFacilityAll() {
  //   return xjaxios.post("/v3/facility/facility/queryByCondition", {
  //     // organizationNo: sessionStorage.organizationNo
  //   })
  //   // return xjaxios.get(`/facility/queryAll`);
  // },
  /**
  * @description: 主键查询设施信息
  * @param {String} facilityId *
  * @return {Array}
  // */
  queryAllFacilityDetail() {
    return xjaxios.get("/v3/facility/facility/queryAllFacilityDetail")
    // return xjaxios.get(`/facility/queryAll`);
  },
  queryLessesByCondition(e) {
    return xjaxios.post("v3/lessee/lessee/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      contactStatus: e
      // organizationList: sessionStorage.organizationList
    })
  },
  queryonInfoByCondition(e) {
    return xjaxios.get(`v3/organization/organizationInfo/queryByOrganizationNo?no=${sessionStorage.organizationNo}`)
  }
};
